﻿using System;
using System.Data;
using System.Windows.Forms;
using NDK.Utils;

namespace NDK.Frm
{
    public partial class Dlg_Version : Form
    {
        public Dlg_Version(): base()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 窗体对象实例，单例模式,保证整个工程只有一个实例
        /// </summary>
        private static Dlg_Version _instance;
        private static readonly object singletonLock = new object();
        public static Dlg_Version Instance
        {
            get
            {
                if (_instance == null)
                {
                    lock (singletonLock)
                    {
                        if (_instance == null)
                        {
                            _instance = new Dlg_Version();
                        }
                    }
                }
                return _instance;
            }
        }

        private void Dlg_Version_Load(object sender, EventArgs e)
        {
            try
            {
                string path = Application.StartupPath + @"\Config\SoftwareVersionInfo.csv";
                DataTable dt = FileUtils.OpenCSV(path);
                dgv_VersionInfo.DataSource = dt;
            }
            catch (Exception)
            {
                MessageBox.Show("打开软件版本信息文件失败！");
            }
           
        }
    }
}
